package com.dingreading.cloud.admin.service;

import com.dingreading.cloud.admin.dto.HeadStaffDto;
import com.dingreading.cloud.admin.entity.HeadStaff;
import com.dingreading.cloud.common.util.PageUtil;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;

import java.util.List;

/**
 * 服务层。
 *
 * @author Administrator
 * @since 2023-11-22
 */
public interface HeadStaffService extends IService<HeadStaff> {

    Page<HeadStaffDto> pageList(PageUtil pageUtil, Integer enabled, String phone, String userName);

    /**
     * 根据手机号获取
     *
     * @param phone 手机号
     * @return list
     */
    HeadStaffDto getByPhone(String phone);

    /**
     * 批量修改状态
     *
     * @param status 状态 -1.禁用 1.正常
     * @param idList id集合
     */
    void updateStatus(Integer status, List<Long> idList);

    List<HeadStaff> getUseList();

    HeadStaff getByUid(String uid);

    HeadStaffDto dtoGetByUid(String uid);

    List<HeadStaff> getByUids(List<String> uid);

    List<HeadStaff> getByRoleId(Long roleId);

    List<HeadStaff> getByRoleIdIn(List<Long> roleIds);

    boolean havePhone(Long id, String phone);

    // 更新登录信息
    boolean updateLoginInfo(String staffUid, String token, String loginTime);

}
